﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using QLTV_Public;

namespace QLTV_Data
{
   public class PhieuPhat_Data
    {
       KetNoiCSDL_Data kn = new KetNoiCSDL_Data();
       public DataTable TaoBang(string sql)
       {
           return kn.taobang(sql); 
       }
       public DataTable Load_PhieuPhat_QuaHan(string soCaBiet, string maDocGia)
       {
           int Npara = 2;
           string[]name=new string[Npara];
           object[] value = new object[Npara];
           name[0] = "@SoCaBiet";
           value[0] = soCaBiet;
           name[1] = "@MaDocGia";
           value[1] = maDocGia;

           return kn.LayDuLieu("Load_PhieuPhat_QuaHan",name,value,Npara);
       }
       public int Insert(PhieuPhat_Public obj)
       {
           int Npara = 5;
           string[] name = new string[Npara];
           object[] value = new object[Npara];
           name[0] = "@MaPhieuPhat";
           value[0] = obj.MaPhieuPhat;
           name[1] = "@MaDocGia";
           value[1] = obj.MaDocGia;
           name[2] = "@NgayLapPhieu";
           value[2] = obj.NgayLapPhieu;
           name[3] = "@TongTien";
           value[3] = obj.TongTien;
           name[4] = "@MaNhanVien";
           value[4] = obj.MaNhanVien;

           return kn.update("Insert_PhieuPhat",name,value,Npara);
       }
    }
}
